package work20241202_chap5oop.i_oop;

/**
 * @author zdl
 * @date 2024/12/2
 */

class ClassA {
    int value;
}

public class Demo11 {
    public static void main(String args[]) {
        ClassA ca = new ClassA();
        changeValue(ca);
        System.out.println(ca.value);//100
        changeRef(ca);
        System.out.println(ca.value);//100
    }

    public static void changeValue(ClassA ca) {
        ca.value = 100;
    }

    public static void changeRef(ClassA ca) {
        ca = new ClassA();
        ca.value = 200;
    }
}